classDiagram
    class Component {
        <<interface>>
        +operation(): void
    }
    
    class Composite {
        -children: List~Component~
        +operation(): void
        +add(component: Component): void
        +remove(component: Component): void
        +getChild(index: int): Component
    }

    class Leaf {
        +operation(): void
    }

    Component <|-- Composite : implements
    Component <|-- Leaf : implements

    Composite --> Component : contains >
